/**
* Created by yyr on 2018/1/10
*已设立基金》基本信息详情
*/
<template>
    <div>
        <div class="ca-box-border-top-none ca-p-22" v-if="!isBasicEdit">
            <el-row>
                <el-col :span="12" class="ca-title">
                    <h3>基本信息</h3>
                </el-col>
                <el-col :span='12' class="ca-align-right">
                    <el-button type="text" :disabled='!isAuthBasicEdit' @click="fundBasicEdit()" class="ca-edit-btn el-icon-edit">编辑</el-button>
                </el-col>
            </el-row>
            <div>
                <el-form label-width="200px">
                    <el-row>
                        <el-col :span="12">
                            <el-form-item label="管理类型	：">
                                {{fundEst.manType | getNameById('fundManType')}}
                            </el-form-item>
                        </el-col>
                        <el-col :span="12">
                            <el-form-item label="管理形式：">
                                {{fundEst.fundForm | getNameById('fundForm')}}
                            </el-form-item>
                        </el-col>
                    </el-row>
                    <el-row>
                        <el-col :span="12">
                            <el-form-item label="管理公司：" class="wordWrap">
                                {{fundEst.company}}
                            </el-form-item>
                        </el-col>
                        <el-col :span="12">
                            <el-form-item label="执行事务合伙人：" class="wordWrap">
                                {{fundEst.partnerName}}
                            </el-form-item>
                        </el-col>
                    </el-row>
                    <el-row>
                        <el-col :span="12">
                            <el-form-item label="基金委派代表：" class="wordWrap">
                                {{fundEst.fundDelegate}}
                            </el-form-item>
                        </el-col>
                        <el-col :span="12">
                            <el-form-item label="基金托管人：" class="wordWrap">
                                {{fundEst.custodian}}
                            </el-form-item>
                        </el-col>
                    </el-row>
                    <el-row>
                        <el-col :span="12">
                            <el-form-item label="注册地：" class="wordWrap">
                                {{fundEst.place}}
                            </el-form-item>
                        </el-col>
                        <el-col :span="12">
                            <el-form-item label="办公地：" class="wordWrap">
                                {{fundEst.officeLand}}
                            </el-form-item>
                        </el-col>
                    </el-row>
                    <el-row>
                        <el-col :span="12">
                            <el-form-item label="统一信用代码：" style="word-break: break-all;" class="wordWrap">
                                {{fundEst.creditCode}}
                            </el-form-item>
                        </el-col>
                        <el-col :span="12">
                            <el-form-item label="投资决策委员会：">
                                <span class="ca-font-size-14 ca-m-l-10" v-for="(i,index) in fundCommitteeList" :key="index">
                                        {{i.committeeName}}
                                    </span>
                            </el-form-item>
                        </el-col>
                    </el-row>
                    <el-row>
                        <el-col :span="12">
                            <el-form-item label="信息披露：" class="wordWrap">
                                {{fundEst.disclosure}}
                            </el-form-item>
                        </el-col>
                        <el-col :span="12">
                            <el-form-item label="管理费：" class="wordWrap">
                                {{fundEst.proportion}}
                            </el-form-item>
                        </el-col>
                    </el-row>
                    <el-row>
                        <el-col :span="24">
                            <el-form-item label="投资限制：" class="wordWrap">
                                {{fundEst.restrictions}}
                            </el-form-item>
                        </el-col>
                    </el-row>
                    <el-row>
                        <el-col :span="24">
                            <el-form-item label="收益分配：" class="wordWrap">
                                {{fundEst.distribution}}
                            </el-form-item>
                        </el-col>
                    </el-row>
                    <el-row>
                        <el-col :span="24">
                            <el-form-item label="其他：" class="wordWrap">
                                {{fundEst.other}}
                            </el-form-item>
                        </el-col>
                    </el-row>
                </el-form>
                <div class="clear"></div>
            </div>

        </div>
        <csFundDetailsBasicEdit v-if="isBasicEdit" @isEdit="isEdit" @addRedDot="addRedDot"></csFundDetailsBasicEdit>
    </div>
</template>

<script type="text/ecmascript-6">
    import {api} from '../api';
    import {STATUS_HTTP_SUCCESS, apiHttp} from '__service/csHttp';
    import {isNoAuth} from '__service/utils';
    export default {
        data() {
            return {
                isAuthBasicEdit: isNoAuth('已设立基金-基金详情-编辑'),
                itemId: this.$route.params.fundId,
                isBasicEdit: false,
                fundBasicData: {},
                fundEst: {
                    manType: null,//管理类型
                    company: '', //管理公司
                    fundForm: '',//管理形式
                    fundDelegate: '',//基金委派代表
                    partnerName: '',//执行事务合伙人名称
                    partnerId: '',//执行事务合伙人id
                    place: '',//注册地
                    creditCode: '',//统一信用代码
                    disclosure: '',//信息披露
                    proportion: null,//管理费
                    restrictions: '',//投资限制
                    other: '',//其他
                },
                fundCommitteeList: [],
                distribution: '',//收益分配
            }
        },
        props: {
        },
        created() {
            this.getBasicDetail();
        },
        methods: {
            getBasicDetail() {
                apiHttp(api.BASIC_DETAIL,{fundId: this.itemId}).then( ret=>{
                    if (ret.resCode === STATUS_HTTP_SUCCESS) {
                        this.fundBasicData = ret.data;
                        this.fundEst = ret.data.fundEst;
                        this.fundCommitteeList = ret.data.fundCommitteeList;
                    }
                })
            },
            //基金基本信息点编辑
            fundBasicEdit() {
                this.isBasicEdit = true;
            },
            isEdit(val) {
                this.isBasicEdit = val;
                this.getBasicDetail();
            },
            addRedDot() {
                this.$emit('addRedDot', 0)
            }
        },
        components: {
            'csFundDetailsBasicEdit': require('./edit.vue'),//选项卡基金信息edit页
        },
    }
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
    .wordWrap{
        word-break: break-all;
    }
</style>
